Skip to content

Conversation

@rosen-vladimirov
Copy link
Contributor

Currently when you set library in your webpack.config.js, you are able to debug your app on windows, but not on macOS and Linux. The problem is in the way path.join works for UNIX style paths. The current code appends ./ in the beginning of the path, which is normally a full path:

path.join(`.//Users/vladimirov/Work/nativescript-cli-2/scratch/app1`, "test1.js")
'Users/vladimirov/Work/nativescript-cli-2/scratch/app1/test1.js'

As you can see, this removes the starting / from the full path, so the VSCode extension is unabel to get correct path to the searched file (webpack.config.js in our case).
On windows the result is:

> path.join("./D:\\Work\\nativescript-cli\\scratch\\app1", "test1.js")
'D:\\Work\\nativescript-cli\\scratch\\app1\\test1.js'

Currently when you set library in your webpack.config.js, you are able to debug your app on windows, but not on macOS and Linux. The problem is in the way `path.join` works for UNIX style paths. The current code appends `./` in the beginning of the path, which is normally a full path:
```
path.join(`.//Users/vladimirov/Work/nativescript-cli-2/scratch/app1`, "test1.js")
'Users/vladimirov/Work/nativescript-cli-2/scratch/app1/test1.js'
```

As you can see, this removes the starting `/` from the full path, so the VSCode extension is unabel to get correct path to the searched file (webpack.config.js in our case).
On windows the result is:
```
> path.join("./D:\\Work\\nativescript-cli\\scratch\\app1", "test1.js")
'D:\\Work\\nativescript-cli\\scratch\\app1\\test1.js'
```

Fix this by removing the `./` from the beginning - it was added there by mistake.
@rosen-vladimirov rosen-vladimirov self-assigned this Sep 13, 2019
@cla-bot cla-bot bot added the cla: yes label Sep 13, 2019
@rosen-vladimirov rosen-vladimirov merged commit 6f8dca0 into master Sep 13, 2019
@rosen-vladimirov rosen-vladimirov deleted the vladimirov/fix-full-path branch September 13, 2019 13:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants